#include "aboutdialog.h"
#include "ui_aboutdialog.h"

AboutDialog::AboutDialog(QWidget* parent) :
    QDialog(parent),
    ui(new Ui::AboutDialog)
{
    ui->setupUi(this);
}

AboutDialog::~AboutDialog()
{
    delete ui;
}

void AboutDialog::changeEvent(QEvent* e)
{
    QDialog::changeEvent(e);

    switch(e->type())
    {
        case QEvent::LanguageChange:
            ui->retranslateUi(this);
            break;

        default:
            break;
    }
}

void AboutDialog::setAuthorized(bool buyed)
{
    if(buyed)
    {
        ui->label_buy->setText(tr("ver: %1").arg(APP_VERSION));
    }
    else
    {
        ui->label_buy->setText(tr("ver: %1 Preview.").arg(APP_VERSION));
    }
}

//关闭
void AboutDialog::on_closeBtn_clicked()
{
    this->close();
}

